const path = require('node:path');
//目录
console.log(path.dirname('/foo/bar/baz/asdf/quux'));
//后缀
console.log(path.extname('index.html'));
//文件名
console.log(path.basename('/foo/bar/baz/asdf/quux.html', '.html'));